// import Loadable from 'react-loadable'
import {lazy} from "react";
// import {Navigate} from "react-router-dom";
import Layout from "@/view/layout";
import {WithCache} from "@/component/cache/WithCache";

// import Person from "@/view/person/Person";
// import List from "@/view/home/list/List";
// import HomeIndex from "@/view/home/index/Index";
// import NotFoundPage from "@/view/netWork/NotFoundPage";



const Person = WithCache(lazy(() => import("@/view/person/Person")));
const List = WithCache(lazy(() => import("@/view/home/list/List")));
const HomeIndex = WithCache(lazy(() => import("@/view/home/index/Index")));
const NotFoundPage = WithCache(lazy(() => import("@/view/netWork/NotFoundPage")));


const RouteArr = [
    {
        path: '/',
        element: <Layout /> ,
        children: [
            {
                path: '/',
                element: <HomeIndex />,
                cache: true
            },
            {
                path: '/list',
                element: <List />,
                cache: true
            },
            {
                path: '/person',
                element: <Person/>,
                cache: true
            }
        ]
    },
    {
        path: '404',
        element: <NotFoundPage/>,
    },
    {
        path: '*',
        // element: <Navigate />,
        element: <NotFoundPage />,
    },
]

export default RouteArr;